package com.share;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

/**
 * @desc:
 * @author:caifan
 * @date:2020/12/20
 */
public class AesUtils {
    final static char[] hex = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'D', 'E', 'F'};

    public static void main(String[] args) {
        byte[] key = new byte[]{0x4A, 0x4b, 0x36, 0x6D, 0x54, 0x4C, 0x64, 0x74, 0x47, 0x63, 0x78, 0x38, 0x6D, 0x62, 0x71, 0x67};
        System.out.println(DigestUtils.sha256Hex(key));
        System.out.println(new String(key));
        Arrays.asList("hello".getBytes()).stream().forEach(System.out::println);
        byte[] bytes = "hello".getBytes();
        for (byte b : bytes) {
            System.out.println(b);
        }
        System.out.println(Integer.toHexString(23));
        System.out.println(Integer.parseInt("4b", 16));
    }

    /*public static String hex2Str(byte[] key) {
        byte[] oct = new byte[key.length];
        for (int i=0; i < key.length; i++) {
            oct[i] = Integer.parseInt();
        }
    }*/
}
